icon: Stop offset'ing in snapshot
authorTimm Bäder <mail@baedert.org>
Sat, 27 May 2017 15:30:01 +0000 (17:30 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:13 +0000 (21:27 -0400)
The snapshot is not offset to the content allocation when ->snapshot is
called.

gtk/gtkicon.c

index 9d1645e661f557daeb66685ef9c1d727e6ca8db8..2539b28dbcd1b409c0ef0bbb9f936519212f7d63 100644 (file)
@@ -47,21 +47,13 @@ gtk_icon_snapshot (GtkWidget   *widget,
   GtkIcon *self = GTK_ICON (widget);
   GtkCssStyle *style = gtk_css_node_get_style (gtk_widget_get_css_node (widget));
   GtkAllocation content_alloc;
-  GtkAllocation alloc;
-  int x, y;
 
-  gtk_widget_get_allocation (widget, &alloc);
   gtk_widget_get_content_allocation (widget, &content_alloc);
 
-  x = content_alloc.x - alloc.x;
-  y = content_alloc.y - alloc.y;
-
-  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_icon (style,
                                snapshot,
                                content_alloc.width, content_alloc.height,
                                self->image);
-  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 static void